home *** CD-ROM | disk | FTP | other *** search
/ 3D World 110 / 3DW_110.iso / mac / Menu / Scenes / home.dir / 00021_Script_generate Product Page < prev    next >
Text File  |  2008-09-12  |  8KB  |  207 lines

  1. global gFormat
  2. global imageMember
  3.  
  4. on generateProductPage aPath
  5.   
  6.   member("comment").text = ""
  7.   
  8.   thePath = aPath
  9.   
  10.   if baFileExists(thePath & "code.txt") = 0 then
  11.     
  12.     Alert ("No code.txt found in: " & thePath)
  13.   else
  14.     
  15.     
  16.     if baFileExists(thePath & "shot.jpg") then
  17.       imageMember.fileName = thePath & "shot.jpg"
  18.       sprite(6).member = imageMember
  19.       
  20.     end if
  21.     
  22.     
  23.     imageMember = member("imagebox")
  24.     
  25.     pText = getnetText(thePath & "info.txt")
  26.     
  27.     cText = getnetText(thePath & "code.txt")
  28.     
  29.     if netDone(pText) then
  30.       textholder = netTextResult(pText)
  31.       
  32.       header = textholder.line[1]
  33.       
  34.       member("product_title").text = header
  35.       
  36.       member("product_header").text = textholder.line[2]
  37.       delete textholder.line[1..3]
  38.       member("product_details").text = textholder
  39.       member("product_details").topspacing = 0
  40.       member("product_details").fixedlinespace = 12
  41.       
  42.       
  43.       
  44.       
  45.       
  46.     end if
  47.     
  48.     bCount = 1
  49.     
  50.     if netDone(cText) then
  51.       codeHolder = netTextResult(cText)
  52.       
  53.       lH = 400
  54.       lV = 520
  55.       
  56.       cCount = 1
  57.       
  58.       repeat with i = 100 to _movie.channel.count
  59.         sprite(i).scriptinstancelist = []
  60.         channel(i).removescriptedsprite()
  61.       end repeat
  62.       
  63.       
  64.       repeat with i = 1 to codeholder.line.count
  65.         if bCount = 2 then lH = 560
  66.         if bCount > 2 then lV = 520
  67.         if bCount = 3 then lH = 400
  68.         if bCount = 4 then 
  69.           lH = 840
  70.           lV = 520
  71.         end if
  72.         
  73.         
  74.         case codeholder.line[i].word[1] of
  75.           "<register>":
  76.             RegTarget = codeholder.line[i].word[2]
  77.             cCount = cCount + 1
  78.             bCount = bCount + 1
  79.             channel(100 + cCount).makescriptedsprite(member("iNSTALLbUTTON"),point(lH,lV))
  80.             add(sprite(100+cCount).scriptInstanceList, new(script "action_button_rollover", 1))    
  81.             _movie.sendSprite(100+cCount, #Initialize, RegTarget, (100+cCount), "register")
  82.             cCount = cCount + 1
  83.             channel(100 + cCount).makescriptedsprite(member("register_text"),point(lH - 40,lV - 11))
  84.             sprite(100+cCount).ink = 36
  85.             
  86.             
  87.           "<install_PC>":
  88.             InstallTarget = codeholder.line[i].char[14..(codeholder.line[i].char.count)]
  89.             cCount = cCount + 1
  90.             bCount = bCount + 1
  91.             channel(100 + cCount).makescriptedsprite(member("iNSTALLbUTTON"),point(lH,lV))
  92.             add(sprite(100+cCount).scriptInstanceList, new(script "action_button_rollover", 1))    
  93.             _movie.sendSprite(100+cCount, #Initialize, InstallTarget, (100+cCount), "install_pc")
  94.             
  95.             cCount = cCount + 1
  96.             channel(100 + cCount).makescriptedsprite(member("Install_PC_text"),point(lH - 40,lV - 11))
  97.             sprite(100+cCount).ink = 36
  98.             
  99.           "<install_MAC>":
  100.             InstallTarget = codeholder.line[i].char[15..(codeholder.line[i].char.count)]
  101.             cCount = cCount + 1
  102.             bCount = bCount + 1
  103.             channel(100 + cCount).makescriptedsprite(member("iNSTALLbUTTON"),point(lH,lV))
  104.             add(sprite(100+cCount).scriptInstanceList, new(script "action_button_rollover", 1))    
  105.             _movie.sendSprite(100+cCount, #Initialize, InstallTarget, (100+cCount), "install_mac")
  106.             
  107.             cCount = cCount + 1
  108.             channel(100 + cCount).makescriptedsprite(member("Install_MAC_text"),point(lH - 40,lV - 11))
  109.             sprite(100+cCount).ink = 36
  110.             
  111.           "<install>":
  112.             InstallTarget = codeholder.line[i].char[11..(codeholder.line[i].char.count)]
  113.             cCount = cCount + 1
  114.             bCount = bCount + 1
  115.             channel(100 + cCount).makescriptedsprite(member("iNSTALLbUTTON"),point(lH,lV))
  116.             add(sprite(100+cCount).scriptInstanceList, new(script "action_button_rollover", 1))    
  117.             _movie.sendSprite(100+cCount, #Initialize, InstallTarget, (100+cCount), "install")
  118.             
  119.             cCount = cCount + 1
  120.             channel(100 + cCount).makescriptedsprite(member("Install_text"),point(lH - 40,lV - 11))
  121.             sprite(100+cCount).ink = 36
  122.             
  123.             
  124.             
  125.             
  126.           "<folder>":
  127.             FolderTarget = codeholder.line[i].char[10..(codeholder.line[i].char.count)]
  128.             cCount = cCount + 1
  129.             bCount = bCount + 1
  130.             channel(100 + cCount).makescriptedsprite(member("iNSTALLbUTTON"),point(lH,lV))
  131.             add(sprite(100+cCount).scriptInstanceList, new(script "action_button_rollover", 1))    
  132.             _movie.sendSprite(100+cCount, #Initialize, FolderTarget, (100+cCount), "folder")
  133.             
  134.             cCount = cCount + 1
  135.             channel(100 + cCount).makescriptedsprite(member("folder_text"),point(lH - 40,lV - 11))
  136.             sprite(100+cCount).ink = 36
  137.             
  138.           "<format>":
  139.             gFormat = codeholder.line[i].char[10..(codeholder.line[i].char.count)]
  140.             
  141.           "<comment>":
  142.             gComment = codeholder.line[i].char[11..(codeholder.line[i].char.count)]
  143.             member("comment").text = gComment
  144.             
  145.             
  146.           "<Website>":
  147.             WebTarget = codeholder.line[i].word[2]
  148.             cCount = cCount + 1
  149.             bCount = bCount + 1
  150.             channel(100 + cCount).makescriptedsprite(member("iNSTALLbUTTON"),point(lH,lV))
  151.             add(sprite(100+cCount).scriptInstanceList, new(script "action_button_rollover", 1))    
  152.             _movie.sendSprite(100+cCount, #Initialize, WebTarget, (100+cCount), "website")
  153.             cCount = cCount + 1
  154.             channel(100 + cCount).makescriptedsprite(member("website_text"),point(lH - 40,lV - 11))
  155.             sprite(100+cCount).ink = 36
  156.             
  157.           "<local_link>":
  158.             WebTarget = thePath & codeholder.line[i].word[2..(codeholder.line[i].word.count)]
  159.             cCount = cCount + 1
  160.             bCount = bCount + 1
  161.             channel(100 + cCount).makescriptedsprite(member("iNSTALLbUTTON"),point(lH,lV))
  162.             add(sprite(100+cCount).scriptInstanceList, new(script "action_button_rollover", 1))    
  163.             _movie.sendSprite(100+cCount, #Initialize, WebTarget, (100+cCount), "local_link")
  164.             cCount = cCount + 1
  165.             channel(100 + cCount).makescriptedsprite(member("website_text"),point(lH - 40,lV - 11))
  166.             sprite(100+cCount).ink = 36
  167.             
  168.           "<Serial>":
  169.             WebTarget = thePath & codeholder.line[i].word[2..(codeholder.line[i].word.count)]
  170.             cCount = cCount + 1
  171.             bCount = bCount + 1
  172.             channel(100 + cCount).makescriptedsprite(member("iNSTALLbUTTON"),point(lH,lV))
  173.             add(sprite(100+cCount).scriptInstanceList, new(script "action_button_rollover", 1))    
  174.             _movie.sendSprite(100+cCount, #Initialize, WebTarget, (100+cCount), "local_link")
  175.             cCount = cCount + 1
  176.             channel(100 + cCount).makescriptedsprite(member("Serial_Text"),point(lH - 40,lV - 11))
  177.             sprite(100+cCount).ink = 36
  178.             
  179.           "<Upgrade>":
  180.             WebTarget = codeholder.line[i].word[2..(codeholder.line[i].word.count)]
  181.             cCount = cCount + 1
  182.             bCount = bCount + 1
  183.             channel(100 + cCount).makescriptedsprite(member("iNSTALLbUTTON"),point(lH,lV))
  184.             add(sprite(100+cCount).scriptInstanceList, new(script "action_button_rollover", 1))    
  185.             _movie.sendSprite(100+cCount, #Initialize, WebTarget, (100+cCount), "website")
  186.             cCount = cCount + 1
  187.             channel(100 + cCount).makescriptedsprite(member("Upgrade_Text"),point(lH - 40,lV - 11))
  188.             sprite(100+cCount).ink = 36
  189.             
  190.             
  191.             
  192.             
  193.             
  194.         end case
  195.       end repeat
  196.       
  197.       
  198.       
  199.       
  200.     end if
  201.   end if
  202.   
  203.   
  204.   
  205.   
  206. end
  207.